Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix ticket list ignoring validation role #17200

Conversation

btry
Copy link
Contributor

@btry btry commented May 29, 2024

When GLPI shows a list of tickets it filters tickets by actors but forgets to filter also by validator

Joined with pluginsGLPI/formcreator#3511 for a possible ticket resolution.

Q A
Bug fix? yes
New feature? yes/no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets internal ref 33123

src/Ticket.php Outdated Show resolved Hide resolved
src/Ticket.php Outdated Show resolved Hide resolved
@trasher trasher marked this pull request as draft June 3, 2024 06:12
@btry btry changed the title DRAFT: fix ticket list ignoring validation role fix ticket list ignoring validation role Jun 6, 2024
@btry btry marked this pull request as ready for review June 6, 2024 07:07
@btry btry marked this pull request as draft June 6, 2024 08:22
@btry btry self-assigned this Jun 6, 2024
@btry btry force-pushed the ticket_list_ignores_validation_role branch 2 times, most recently from cabe62d to 1254b32 Compare June 10, 2024 13:14
$restrict = self::getListForItemRestrict($item);
$criteria['WHERE'] = $restrict + getEntitiesRestrictCriteria(self::getTable());
$criteria['WHERE']['glpi_tickets.is_deleted'] = 0;
$criteria['LIMIT'] = (int)$_SESSION['glpilist_limit'];

switch (get_class($item)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This switch statement needs to be splitted to make the SQL query unit testable
SQL related content moved in a new method
Search options criterias moved in a new method
Specific display and order stay here

@btry btry force-pushed the ticket_list_ignores_validation_role branch from 1254b32 to de602e6 Compare June 10, 2024 13:22
@btry btry force-pushed the ticket_list_ignores_validation_role branch from de602e6 to f1f4ea2 Compare June 10, 2024 13:34
@btry btry force-pushed the ticket_list_ignores_validation_role branch from f1f4ea2 to dc10756 Compare June 10, 2024 13:38
@btry btry marked this pull request as ready for review June 11, 2024 13:09
@btry
Copy link
Contributor Author

btry commented Jun 11, 2024

I focused on tests related to the fix; but it is now possible to add much more cases

Copy link
Member

@cedric-anne cedric-anne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems correct.

src/Ticket.php Outdated Show resolved Hide resolved
src/Ticket.php Outdated Show resolved Hide resolved
tests/functional/Ticket.php Outdated Show resolved Hide resolved
src/Ticket.php Outdated Show resolved Hide resolved
tests/functional/Ticket.php Outdated Show resolved Hide resolved
tests/functional/Ticket.php Outdated Show resolved Hide resolved
@cedric-anne cedric-anne added this to the 10.0.16 milestone Jun 19, 2024
@cedric-anne cedric-anne requested a review from orthagh June 19, 2024 13:43
btry and others added 2 commits June 26, 2024 09:38
Co-authored-by: Cédric Anne <[email protected]>
Co-authored-by: Cédric Anne <[email protected]>
@cedric-anne cedric-anne merged commit aa4ad2c into glpi-project:10.0/bugfixes Jun 26, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants